<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        {
            let res = parseInt(Math.random() * 50 );    //随机数
            console.log(res);
        }
        {
            let res = Math.round(9.49) ;                //四舍五入
            console.log(res);
        }
        {
            let res = Math.ceil(9.1);                   //向上取整
            console.log(res);
        }
        {
            let res = Math.floor(9.1);                  //向下取整
            console.log(res);
        }
        {
            let res = Math.max(1,5,4,7,9,45,1,2,3,54);  //取一组数据最大值
            console.log(res);
        }
        {
            let res = Math.min(1,5,7,1,2,3,54,0.2,2,5); //取一组数据中最小值
            console.log(res);
        }
        
        {
            let res = Math.pow(2,5) ;                     //次方   2的五次方
            console.log(res);
        }
        {
            let res = Math.sqrt(4) ;                     //开平方
            console.log(res);
        }
        {
            let res = Math.abs( -15 ) ;                 //取一个数的绝对值
            console.log(res);
        }
    </script>
</body>
</html>